<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>视频列表</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/jquery-1.11.0.js"></script>
<link rel="stylesheet" type="text/css" href="/PHPUnion/Home/Lib/Pintuer/pintuer.css" />
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/pintuer.js"></script>
<script type="text/javascript" src="/PHPUnion/Home/Lib/Pintuer/respond.js"></script>
	<script type="text/javascript">
	// 按钮全选
	window.onload = function(){
		var oSelsctAll = document.getElementById("selectAll");
		var aInput = document.getElementsByTagName("input");
		oSelsctAll.onclick = function(){
			for(var i = 0;i<aInput.length;i++){
				if(aInput[i].checked == true){
					aInput[i].checked = false;
				}else{
					aInput[i].checked = true;
				}
			}
		}
	}

	// checkbox 全选
	function CheckAll(value,obj){
		var form = document.getElementsByTagName("form")
		for(var i=0;i<form.length;i++){
			for (var j=0;j<form[i].elements.length;j++){
				if(form[i].elements[j].type=="checkbox"){
					var e = form[i].elements[j];
					if (value=="selectAll")
						{
							e.checked=obj.checked
						}else{
							e.checked=!e.checked;
						}
				}
			}
		}
	}
</script>
</head>
<body>
	<div class="container-layout">
	<div class="text-right border margin-top margin-little-bottom padding-right padding-top padding-bottom">
		<button type="button" onClick="location.href='<?php echo U('show',array('cid'=> $_GET['cid']));?>'" class="button radius-none bg-sub">
			<i class="icon-th-list"></i>
			视频列表
		</button>
		<button type="button" onClick="location.href='<?php echo U('AddVideo',array('cid'=> $_GET['cid']));?>'" class="button radius-none">
			<i class="icon-edit"></i>
			添加视频
		</button>
		<button type="button" onClick="location.href='<?php echo U('show',array('cid'=> $_GET['cid'],'video_status'=> 0));?>'" class="button radius-none">
			<i class="icon-eraser"></i>
			未 审 核
		</button>
	</div>
</div>
<form action="" method="POST">
	<div class="container-layout">
		<table class="table table-bordered table-hover table-condensed table-responsive">
			<tr class="bg">
				<td><label><input onclick=CheckAll('selectAll',this) type="checkbox" value="on" name="chkall" /></label></td>
				<td>vid</td>
				<td>视频标题</td>
				<td>所属频道</td>
				<td>视频状态</td>
				<td>发布者</td>
				<td>发布时间</td>
				<td>操 作</td>
			</tr>
			<?php if(is_array($field)): $i = 0; $__LIST__ = $field;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
					<td><label><input type="checkbox" name="vid" id="id" value="{$vo.vid}"/></label></td>
					<td><?php echo ($vo["vid"]); ?></td>
					<td><?php echo ($vo["title"]); ?></td>
					<td><?php echo ($vo["_catname"]); ?></td>
					<td>
						<?php if($vo['video_status'] == 1): ?>已审核
						<?php elseif($vo['video_status'] == 2): ?>
							草稿
							<?php else: ?>
							<div style="color:red;">未审核</div><?php endif; ?>
					</td>
					<td><?php echo ($vo["_author"]); ?></td>
					<td><?php echo (date('Y-m-d H:i:s',$vo["addtime"])); ?></td>
					<td width="350">
						<a href="<?php echo U('Home/Show/show',array('cid'=> $_GET['cid'],'vid'=> $vo['vid']));?>" target="_blank">
							<span class="icon-toggle-right (alias)"></span>
							播放视频
						</a> |
						<?php if($vo['video_status'] == 0): ?><a href="<?php echo U('audit',array('cid'=> $_GET['cid'],'vid'=> $vo['vid'], 'video_status'=> 1));?>">
								<span class="icon-check-circle-o"></span>
								点击审核
							</a> |
							<?php elseif($vo['video_status']): ?>
							<a href="<?php echo U('audit',array('cid'=> $_GET['cid'],'vid'=> $vo['vid'], 'video_status'=> 0));?>">
								<i class="icon-times"></i>
								取消审核
							</a> |<?php endif; ?>
						<a href="<?php echo U('EditVideo',array('cid'=> $_GET['cid'], 'vid'=> $vo['vid']));?>">
							<i class="icon-edit"></i>
							修 改
						</a> |	
						<a href="javascript:;" class="dialogs" data-toggle="click" data-target="#mydialog<?php echo ($vo["vid"]); ?>" data-mask="1" data-width="20%" <?php if($vo["system"] == 1): ?>disabled="disabled"<?php endif; ?>>
							<i class="icon-trash-o"></i>
							删 除
						</a>
						<!-- 删除确认框 Start -->
						<div id="mydialog<?php echo ($vo["vid"]); ?>">
							<div class="dialog bouncein">
								<div class="dialog-head">
									<span class="close icon-times"></span>
									<strong>删除确认对话框</strong>
								</div>
								<div class="dialog-body">
									是否确认删除该视频数据？
								</div>
								<div class="dialog-foot">
									<button class="button bg-sub radius-none" onClick="location.href='<?php echo U('del',array('cid'=> $vo['cid'],'vid'=> $vo['vid']));?>'">
										<i class="icon-check-square-o"></i>
										确 认
									</button>
									<button class="button dialog-close radius-none">
										<i class="icon-times"></i>
										取 消
									</button>
								</div>
							</div>
						</div>
						<!-- 删除确认框 End -->
					</td>
				</tr><?php endforeach; endif; else: echo "" ;endif; ?>
			<tr>
				<td colspan="9">
					<div class="line">
						<div class="x9">
							<button type="button" id="selectAll" class="button bg border">
								<span class="icon-arrows"></span>
								全 选
							</button>
							<?php if($vo["content_status"] == 0): ?><button type="button" class="button bg">
									<span class="icon-check-circle"></span>
									批量审核
								</button>
								<?php else: ?>
								<button type="button" class="button bg">
									<span class="icon-ban"></span>
									批量取消审核
								</button><?php endif; ?>
							<button type="button" class="button bg">
								<span class="icon-reply"></span>
								批量删除
							</button>
						</div>
						<div class="x3"><?php echo ($page); ?></div>
					</div>
				</td>
			</tr>
		</table>
	</div>
</form>
</body>
</html>